package system;

import java.io.InputStream;
import java.util.Map;

import object.model.MySQLData;
import system.mysql_connector.MySQL_Connector;



public class Sys_Config {
	
	private Sys_Config(){
		
	}

	/**
	 * Input Stream of the backup_head_format.xml
	 */
	public final static InputStream backup_head_format = Thread.currentThread().
		getContextClassLoader().getResourceAsStream("backup_head_conf.xml");
	
	/**
	 * Configuration Path
	 */
	public final static String config_xml_path = Thread.currentThread().
		getContextClassLoader().getResource("jdbc_configure.xml").getPath();
	
	/**
	 * Input Stream of the mysql_data_types.xml
	 */
	public final static InputStream mysql_data_stream = Thread.currentThread().
		getContextClassLoader().getResourceAsStream("mysql_data_types.xml");
	
	/**
	 * Database Address
	 */
	public final static String DB_ADDRESS = SysFactory.getInstance().getProperty("DB_ADDRESS");

	/**
	 * Database Port
	 */
	public final static String DB_PORT = SysFactory.getInstance().getProperty("DB_PORT");

	/**
	 * Database Username
	 */
	public final static String DB_USERNAME = SysFactory.getInstance().getProperty("DB_USERNAME");

	/**
	 * Database Password for the current user
	 */
	public final static String DB_PWD = SysFactory.getInstance().getProperty("DB_PWD");
	
	/**
	 * Database Name
	 */
	public final static String DB_NAME = SysFactory.getInstance().getProperty("DB_NAME");

	/**
	 * Database Connection Encoding
	 */
	public final static String DB_DEFAULT_ENCODING = SysFactory.getInstance().getProperty("DB_DEFAULT_ENCODING");

	/**
	 * The SQL-Statement Field For Showing All The Tables In The Current Database
	 */
	public final static String DB_SHOWTABLE_COLLUMNAME = "Tables_in_"+DB_NAME;

	/**
	 * The Data Relation Mapping Between MySQL DataType And Java Native DataType
	 * <br>
	 * String[Key]  : MySQL data type name<br>
	 * MySQLData[Value] : Reference<br>
	 * @see object.model.MySQLData
	 */
	public final static Map<String, MySQLData> MYSQL_DATA_REL = SysFactory.getInstance().getBunchProperties("dt");

	/**
	 * The Package Location For The Table Models In Your Java Project
	 */
	public final static String JAVA_MODEL_PACKAGE = SysFactory.getInstance().getProperty("MODEL_PACKAGE");
	
	/**
	 * MySQL Character Set Relation Mappings
	 */
	public final static Map<String, String> MYSQL_CHARSET_COLLATION_REL = SysFactory.getInstance().getCollationRel();
 
	/**
	 * The Backup Configuration Mapping
	 * <table border="1">
	 * <tr><th>KEY</th> <th>VALUE</td></tr>
	 * <tr><td>SEPERATOR</td><td>Seperator for each SQL in .sql backup file</td></tr>
	 * <tr><td>HEADER_CONTENT</td><td>Head Content for the .sql backup file</td></tr>
	 * </table>
	 */
	public final static Map<String, String> BACKUP_CONFIG_MAP = SysFactory.getInstance().getBackupConfigureMap();
	
	/**
	 * MySQL MetaData [Keys Listed Followed]
	 */
	public final static Map<String, String> BACKUP_SYS_MAP = SysFactory.getInstance().getDatabaseMetaDataMap();
	
	/**
	 * KEYS-[In MySQLMetaData] - Product Version
	 */
	public final static String KEY_PROCDUCT_VER = "SYS_DB_VERSION";
	/**
	 * KEYS-[In MySQLMetaData] - Product Name
	 */
	public final static String KEY_PROCDUCT_NAME = "SYS_DB_NAME";
	/**
	 * KEYS-[In MySQLMetaData] - Driver Name
	 */
	public final static String KEY_DRIVER_NAME = "SYS_DRV_NAME";
	/**
	 * KEYS-[In MySQLMetaData] - Driver Version
	 */
	public final static String KEY_DRIVER_VER = "SYS_DRV_VERSION";
	
	
}
